package com.itita.ww2.utils.channel.payment;

import com.itita.ww2.enums.ChannelEnum;

/**
 * 谷歌订单信息
 * @author NorthLan
 *
 */
public class GoogleOrderInfo extends OrderInfo {
	private int purchaseState;
	private int consumptionState;
	private String kind;

	public GoogleOrderInfo(String orderId) {
		super(orderId);
		this.channel = ChannelEnum.GOOGLE.getValue();
	}

	public int getPurchaseState() {
		return purchaseState;
	}

	public void setPurchaseState(int purchaseState) {
		this.purchaseState = purchaseState;
	}

	public int getConsumptionState() {
		return consumptionState;
	}

	public void setConsumptionState(int consumptionState) {
		this.consumptionState = consumptionState;
	}

	public String getKind() {
		return kind;
	}

	public void setKind(String kind) {
		this.kind = kind;
	}

	/**
	 * 是否支付成功
	 */
	public boolean isPurchaseSucc() {
		return purchaseState == 0;
	}

	/**
	 * 是否验证成功
	 */
	public boolean isValidateSucc() {
		return isPurchaseSucc() && isConsumptionSucc();
	}

	/**
	 * 是否消费成功
	 */
	public boolean isConsumptionSucc() {
		return consumptionState == 1;
	}

}
